package com.saas.util;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;


public class Constant {
	
	/** 活动代金券队列缓存**/
	public static ConcurrentHashMap<String, ConcurrentLinkedQueue<JSONObject>> ACTIVITY_VOUCHERS = new ConcurrentHashMap<String, ConcurrentLinkedQueue<JSONObject>>();
	
	/**
	 * 客户端输出
	 */
	public static final String CLIENT_RESPONSE = "app_client_response";	
	
	/******************************特殊模型****************************************/
	public static final String model_ticketChannel = "ticketChannel";
	/**
	 * 用户模型
	 */
	public static final String model_users = "users";
	
	/**
	 * 文件模型
	 */
	public static final String model_files = "files";
	
	
	/**
	 * 验证码模型
	 */
	public static final String model_codes = "codes";
	/**
	 * 验证码模型
	 */
	public static final String model_orderPaymentDetails = "OrderPaymentDetails";
	
	/**
	 * 验证码模型
	 */
	public static final String model_notifications = "notifications";
	
	/**
	 * 安装设备表
	 */
	public static final String model_DeviceInstallation = "DeviceInstallation";
	
	/**
	 * 访问日志记录
	 */
	public static final String model_ADLog = "ADLog";
	
	/**
	 * 短信模板模型
	 */
	public static final String model_smsTemplate = "smsTemplate";
	
	public static final String model_merchantLogin = "MerchantLogin";
	
	public static final String MainPageCategoryBlock = "MainPageCategoryBlock";
	
	public static final String MainPageCategoryBannerBlock = "MainPageCategoryBannerBlock";
	
	public static final String MainPageTopicBlock = "MainPageTopicBlock";
	/** 商户类别表*/
	public static final String model_merchantCategory = "MerchantCategory";
	/** 字典表**/
	public static final String model_dictionary = "Dictionary";
	/** 代金券领取表**/
	public static final String model_userVouchers = "UserVouchers";
	/** 代金券表**/
	public static final String model_vouchers = "Vouchers";
	/** 代金券对应活动表**/
	public static final String model_voucherActivity = "VoucherActivity";
	/** 订单表**/
	public static final String model_order = "Order";
	/** 团单表**/
	public static final String model_groupitem = "GroupItem";
	/** 商户表**/
	public static final String model_merchant = "Merchant";
	/** 商品表**/
	public static final String model_production = "MerchantProduction";
	/** 关联商品表**/
	public static final String model_productionRelatiion = "MerchantProductionRelation";
	/** 退款表**/
	public static final String model_ticketRefund = "TicketRefund";
	/** 支付码表**/
	public static final String model_merchantTicket = "MerchantTicket";
	/** 退款日志表**/
	public static final String model_refundLog = "RefundOperationLog";
	/** 推荐商品表 **/
	public static final String model_mainproduct = "MainpageProductBlock";
	/** crm商户合同 **/
	public static final String model_contract = "Contract";
	/** crm商户表 **/
	public static final String model_crmMerchant = "CRMCustomer";
	/** crm账单表 **/
	public static final String model_crmMerchantBill = "MerchantBill";
	/** crm账单明细表 **/
	public static final String model_crmMerchantBillDetail = "MerchantBillDetail";
	/** crm账单日志表 **/
	public static final String model_crmMerchantBillLog = "MerchantBillLog";
	/** crm商户产品表 **/
	public static final String model_crmMerchantProduct = "CRMCustomerProduction";
	/** crm验证码表 **/
	public static final String model_crmTickets = "CustomerTicket";
	/** 活动橱窗表 **/
	public static final String model_LTActivityBlock = "LTActivityBlock";
	/** 活动表 **/
	public static final String model_LTActivity = "LTActivity";
	/** 活动产品表 **/
	public static final String model_LTActivityProduction = "LTActivityProduction";
	/**商品红包活动关系表**/
	public static final String model_ProductActivity="ProductActivity";
	/** 订单按日统计 **/
	public static final String model_StatisOrder = "StatisOrder";
	/** 消费码按日统计 **/
	public static final String model_StatisTicket = "StatisTicket";
	
	/**搜索关键词统计表**/
	public static final String model_SearchKeywordStatistics = "SearchKeywordStatistics";
	
	/******************************特殊模型****************************************/
	
	
	/******************************所有模型都有字段****************************************/
	/**
	 * 创建时间
	 */
	public static final String CREATED_AT = "createdAt";
	
	/**
	 * 更新时间
	 */
	public static final String UPDATED_AT = "updatedAt";
	
	/**
	 * 主键key
	 */
	public static final String OBJECTID = "objectId";
	
	/******************************所有模型必有字段****************************************/

	/******************************用户users模型必有字段****************************************/
	
	public static final String user_defaultPassword = "saas123456";
	
	public static final String user_lastLoginTime = "lastLoginTime";
	
	public static final String user_tokens = "tokens";
	
	public static final String user_sessionToken = "sessionToken";
	
	public static final String user_importFromParse = "importFromParse";
	
	public static final String user_secretKey = "secretKey";
	
	public static final String user_phonenum = "phonenum";
	
	public static final String user_mobilePhoneVerified = "mobilePhoneVerified";
	
	public static final String user_username = "username";
	
	public static final String user_password = "password";
	
	public static final String user_email = "email";
	
	public static final String user_site = "site";
	
	public static final String user_siteUserId = "siteUserId";
	
	public static final String user_birthday = "birthday";
	
	public static final String user_id_no = "id_no";
	
	public static final String user_realname = "realname";
	
	public static final String user_description = "description";
	
	public static final String user_roleid = "roleid";//指定用户身份：超级管理员、商户管理员等
	
	public static final String user_currentVersion = "currentVersion";//用户当前使用版本
	
	public static final String user_regVersion = "regVersion";//用户注册版本
	
	/******************************用户users模型必有字段****************************************/
	
	/******************************文件files模型必有字段****************************************/
	public static final String files_content = "content";
	public static final String files_path = "path";
	public static final String files_host = "host";
	public static final String files_filetype = "fileType";
	/******************************文件files模型必有字段****************************************/
	
	/******************************验证码模型必有字段****************************************/
	public static final String codes_mobile = "mobile";
	public static final String codes_code = "code";
	public static final String codes_due_time = "duetime";
	/******************************验证码模型必有字段****************************************/
	
	/******************************特定动作处理********************************************/
	
	/**
	 * 登录
	 * GET
	 */
	public static final String method_login = "login";
	
	public static final String sha512_salt = "saas!@#";
	
	/**
	 * 重置密码
	 * POST
	 */
	public static final String method_requestPasswordReset = "requestPasswordReset";
	
	/**
	 * 请求发送用户手机号码验证短信
	 * POST
	 */
	public static final String method_requestMobilePhoneVerify = "requestMobilePhoneVerify";
	
	/**
	 * 使用验证码验证用户手机号
	 * POST
	 */
	public static final String method_verifyMobilePhone  = "verifyMobilePhone";
	
	/**
	 * 请求验证用户邮箱
	 * POST
	 */
	public static final String method_requestEmailVerify = "requestEmailVerify";
	
	/**
	 * 更新密码, 要求输入旧密码
	 * PUT
	 */
	public static final String method_updatePassword = "updatePassword";
	
	/******************************特定动作处理********************************************/
	
	public static final SerializerFeature[] serializerFeatures = { 
		SerializerFeature.WriteMapNullValue, // 输出空置字段
        SerializerFeature.WriteNullListAsEmpty,//list字段如果为null，输出为[]，而不是null
        SerializerFeature.WriteNullNumberAsZero,// 数值字段如果为null，输出为0，而不是null
        SerializerFeature.WriteNullBooleanAsFalse,//Boolean字段如果为null，输出为false，而不是null
        SerializerFeature.WriteNullStringAsEmpty,// 字符类型字段如果为null，输出为""，而不是null
	};
	
	public static final String API_CALL_STATUS_SUCCESS = "10000";
	public static final String API_CALL_STATUS_SUCCESS_MSG = "调用成功";
	
	public static final String API_CALL_STATUS_ERROR_INVALID_ACCESS_TOKEN = "10001";
	public static final String API_CALL_STATUS_ERROR_INVALID_ACCESS_TOKEN_MSG = "access_token无效";

	public static final String API_CALL_STATUS_ERROR_INVALID_SIGN = "10002";
	public static final String API_CALL_STATUS_ERROR_INVALID_SIGN_MSG = "签名失败";

	public static final String API_CALL_STATUS_ERROR_EXCEPTION = "11000";
	public static final String API_CALL_STATUS_ERROR_EXCEPTION_MSG = "系统异常";
	
	/** 用户图片上传目录 */
	public static final String USER_UPLOAD_DIRECTORY = "userfiles";
	
	/**用户登录标识键*/
	public static final String User_loginIdentifying = "loginIdentifying";
	
	
	/**
	 * 品牌搜索字段
	 */
	public static final String BRAND_SEARCH_KEY="key";
	
	/**
	 * 产品名称 速印
	 */
	public static final String saas_babyprinting_app = "babyprinting";
	
	/**
	 * 产品名称 快跑
	 */
	public static final String saas_saas_app = "saas";
	
	public static final String user_message_List_key = "user_message_list_";
	
	public static final String user_message_count_key = "user_message_count_";
	
	public static final String user_friend_dynamic_key = "user_friend_dynamic_";
	
	public static final String user_center_dynamic_key = "user_center_dynamic_";
	
	public static final String user_orderPay_list_key = "user_orderPay_list_key";
	
	public static final String user_orderPay_count_key = "user_orderPay_count_key";
	/**
	 * 高级检索接口中的数据
	 */
	public static final String RESULTS="results";
	
	public static final String DeviceType_IOS = "ios";
	
	public static final String DeviceType_Android = "android";
	
	/**
	 * 支付平台-微信支付
	 */
	public static final String PAY_PLATFORM_WEIXIN = "weixin";
	
	/**
	 * 支付平台-微信支付-JSAPI
	 */
	public static final String PAY_PLATFORM_WEIXIN_JSAPI = "JSAPI";
	
	/**
	 * 支付平台-微信支付-JSAPI
	 */
	public static final String PAY_PLATFORM_WEIXIN_SAOMA = "NATIVE";
	
	/**
	 * 支付平台-支付宝
	 */
	public static final String PAY_PLATFORM_ALIPAY = "alipay";
	
	/**
	 * 支付平台-微信支付-JSAPI
	 */
	public static final String PAY_PLATFORM_ALIPAY_JSAPI = "alipayJS";
	/**
	 * 首单字典分组值
	 */
	public static final String FIRST_ORDER_DISCOUNT = "FIRST_ORDER_DISCOUNT";
	/**
	 * 用户领取代金券的活动编号值
	 */
	public static final String ACTIVITY_NO_DISCOUNT = "ACTIVITY_NO_DISCOUNT";
	/**
	 * 账单异常通知小组
	 */
	public static final String EXCEPTION_BILL_GROUP = "EXCEPTION_BILL_GROUP";
	

	/***********************************消费码验码使用       start ****************************************************/
	
	/**退款类型, 1:不能退*/
	public static final int REFUNDTYPE_CANNOT = 1; 
	/**退款类型, 2:未使用退*/
	public static final int REFUNDTYPE_NOTUSED = 2; 
	/**退款类型, 3:过期退*/
	public static final int REFUNDTYPE_EXPIRE = 3; 
	
	
	/**消费码使用状态，0：未使用*/
	public static final int USESTATUS_UNTAPPED = 0;
	/**消费码使用状态，1：已使用*/
	public static final int USESTATUS_USED = 1;
	/**消费码使用状态，2：已过期*/
	public static final int USESTATUS_EXPIRE = 2;
	
	
	/**消费码生成方式，0：系统生成*/
	public static final int CODETYPE_SYSGEN = 0;
	/**消费码生成方式，1：运营生成*/
	public static final int CODETYPE_OPERATIONS = 1;
	/**消费码生成方式，2：商户生成*/
	public static final int CODETYPE_MERCHANT = 2;
	/**消费码生成方式，3：第三方系统生成*/
	public static final int CODETYPE_THIRDPARTY = 3;
	
	/***********************************消费码验码使用       start ****************************************************/
	
	public static final int FIND_RESULT_MAX = 1000;
}
